package com.dalin.platform.etl.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.dalin.common.base.BaseObject;

/*****************************************************************************
 * @content: 类信息 *
 * @author : 那建林 *
 * @crtDate: 2010-12-05 21:54:43 *
 * @modDate: 2010-12-05 21:54:43 *
 * @version: 1.00 *
 ****************************************************************************/
@Entity
@Table(name = "ETL_COLUMN_VIEW")
public class EtlColumnViewEntity extends BaseObject {
	private Long columnViewId; // COLUMN_VIEW_ID,16,0
	private Long columnId; // COLUMN_ID,16,0
	private String remark; // REMARK,256,0
	private String dicTypeCode; // DIC_TYPE_CODE,64,0
	private Integer displayWay; // DISPLAY_WAY,8,0
	private Integer usable; // USABLE,8,0

	@Id
	@Column(name="COLUMN_VIEW_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "ETL_COLUMN_VIEW",
        allocationSize=1
    )
    public Long getColumnViewId() {
		return columnViewId;
	}

	public void setColumnViewId(Long columnViewId) {
		this.columnViewId = columnViewId;
	}


	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "DIC_TYPE_CODE")
	public String getDicTypeCode() {
		return dicTypeCode;
	}

	public void setDicTypeCode(String dicTypeCode) {
		this.dicTypeCode = dicTypeCode;
	}

	@Column(name = "DISPLAY_WAY")
	public Integer getDisplayWay() {
		return displayWay;
	}

	public void setDisplayWay(Integer displayWay) {
		this.displayWay = displayWay;
	}


	@Column(name = "USABLE")
	public Integer getUsable() {
		return usable;
	}

	public void setUsable(Integer usable) {
		this.usable = usable;
	}

	@Column(name = "COLUMN_ID")
	public Long getColumnId() {
		return columnId;
	}

	public void setColumnId(Long columnId) {
		this.columnId = columnId;
	}
	
	@Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (columnId == null ? 0 : columnId.hashCode());
        njlrst = 31 * njlrst + (remark == null ? 0 : remark.hashCode());
        njlrst = 31 * njlrst + (dicTypeCode == null ? 0 : dicTypeCode.hashCode());
        njlrst = 31 * njlrst + (displayWay == null ? 0 : displayWay.hashCode());
        njlrst = 31 * njlrst + (usable == null ? 0 : usable.hashCode());
        njlrst = 31 * njlrst + (columnViewId == null ? 0 : columnViewId.hashCode());
        return njlrst;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof EtlColumnViewEntity)) return false;
        final EtlColumnViewEntity other = (EtlColumnViewEntity) o;
        if (columnId == null) {
            if (other.columnId != null) return false;
        } else if (!columnId.equals(other.columnId)) {
            return false;
        }
        if (remark == null) {
            if (other.remark != null) return false;
        } else if (!remark.equals(other.remark)) {
            return false;
        }
        if (dicTypeCode == null) {
            if (other.dicTypeCode != null) return false;
        } else if (!dicTypeCode.equals(other.dicTypeCode)) {
            return false;
        }
        if (displayWay == null) {
            if (other.displayWay != null) return false;
        } else if (!displayWay.equals(other.displayWay)) {
            return false;
        }
        if (usable == null) {
            if (other.usable != null) return false;
        } else if (!usable.equals(other.usable)) {
            return false;
        }
        if (columnViewId == null) {
            if (other.columnViewId != null) return false;
        } else if (!columnViewId.equals(other.columnViewId)) {
            return false;
        }
        return true;
    }
}
